package com.chance.cc.crawler.prod.command.trigger.domain.news.youku;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.youku.searchKw.YouKuSearchKwRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.youku.searchKw.YouKuSearchKwTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.youku.searchKw.YouKuSearchKwTraceTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;


public class YouKuCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {
    public static void main(String[] args) {
        publishYouKuSearchKwRealtimeCrawlerScheduleTriggerInfo();
        publishYouKuSearchKwTraceCrawlerScheduleTriggerInfo();
        publishYouKuSearchKwTraceTraceCrawlerScheduleTriggerInfo();
    }

    public static void publishYouKuSearchKwRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = YouKuSearchKwRealtimeCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                YouKuSearchKwRealtimeCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/10 * * * ?",
                "优酷视频关键词实时采集任务执行，每十分钟执行一次"
        );
    }

    public static void publishYouKuSearchKwTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = YouKuSearchKwTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                YouKuSearchKwTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "优酷视频关键词回溯采集任务执行，每一个小时执行一次"
        );
    }

    public static void publishYouKuSearchKwTraceTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = YouKuSearchKwTraceTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                YouKuSearchKwTraceTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "优酷视频关键词回溯7天采集任务，每天凌晨1点执行"
        );
    }
}
